import { defineStore } from 'pinia'

const clampMultiplier = (value: number) => Math.min(4, Math.max(0.5, value))

export const useSettingsStore = defineStore('renderSettings', {
  state: () => ({
    samplingMultiplier: 1,
  }),
  actions: {
    setSamplingMultiplier(value: number) {
      this.samplingMultiplier = clampMultiplier(value)
    },
  },
})
